package com.corpgovernment.organization.enumm.budget;

import java.util.LinkedHashMap;
import java.util.Map;

public enum BudgetChangeEnum {

    INACTIVE(0, "停用"),
    ACTIVE(1, "启用"),
    DELETE(2, "删除");

    private Integer code;
    private String desc;

    BudgetChangeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<Integer, BudgetChangeEnum> codeMap = new LinkedHashMap<>();

    static {
        for (BudgetChangeEnum budgetChangeEnum : BudgetChangeEnum.values()) {
            codeMap.put(budgetChangeEnum.getCode(), budgetChangeEnum);
        }
    }

    public static BudgetChangeEnum getEnumByCode(Integer code) {
        return codeMap.get(code);
    }
}